package com.ruge.algorithm.linear;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
 * @program: ruge-algorithm
 * @description:
 * @author: ruge.wu
 * @create: 2021-12-27 22:50
 **/
public class SequenceListTest {
    public static SequenceList<String> sequenceList = new SequenceList(2);

    @Before
    public void before() {
        sequenceList.insert("姚明");
        sequenceList.insert("科比");
        sequenceList.insert("麦迪");
        sequenceList.insert("艾弗森");
        sequenceList.insert(1, "卡特");
    }

    @Test
    public void testClear() {
        sequenceList.clear();
    }

    @Test
    public void testIsEmpuy() {
        System.out.println(sequenceList.isEmpty());
    }

    @Test
    public void testLength() {
        System.out.println(sequenceList.length());
    }

    @Test
    public void testGet() {
        System.out.println(sequenceList.get(3));
    }

    @Test
    public void testRemove() {
        System.out.println(sequenceList.remove(1));
    }

    @After
    public void iterator() {
        for (int i = 0; i < sequenceList.length(); i++) {
            System.out.println(sequenceList.get(i));
        }
    }
}
